package com.poly.system.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.poly.system.domain.SysAppMenu;
import com.poly.system.pojo.dto.SysAppMenuDTO;
import com.poly.system.pojo.query.SysAppMenuQuery;
import com.poly.system.pojo.vo.SysAppMenuVO;

import java.util.List;

/**
 * 应用菜单Service接口
 *
 * @author poly
 * @date 2024-01-02
 */
public interface ISysAppMenuService extends IService<SysAppMenu>
{
    /**
     * 获取查询对象
     * @param query
     * @return
     */
    LambdaQueryWrapper<SysAppMenu> getWrapper(SysAppMenuQuery query);

    Long add(SysAppMenuDTO dto);


    boolean update(SysAppMenuDTO dto);


    void delete(List<Long> menuIdList);

    List<SysAppMenuVO> list(SysAppMenuQuery query);

    List<SysAppMenuVO> menuTree(Long orgId, List<Long> roleIdList, Long userId);

    /**
     * 根据父节点的ID获取所有子节点
     */
    List<SysAppMenuVO> getChildPerms(List<SysAppMenu> list, Long parentId);

}
